package com.otv.model;

import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;

@Entity
public class AutomaticTask extends Task {
	private HoraireType horaireType;
	private Reccurense reccurense;
	private Integer repetition;
	private Date startDate;
	private EndType endType;
	@ManyToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
	@JoinTable(name = "autotask_dayofweek", joinColumns = { @JoinColumn(name = "autotask_id", nullable = true, updatable = true) }, inverseJoinColumns = { @JoinColumn(name = "dayofweek_id", nullable = true, updatable = true) })
	private List<DayOfWeekend> dayOfWeekend;

	public HoraireType getHoraireType() {
		return horaireType;
	}

	public void setHoraireType(HoraireType horaireType) {
		this.horaireType = horaireType;
	}

	public Reccurense getReccurense() {
		return reccurense;
	}

	public void setReccurense(Reccurense reccurense) {
		this.reccurense = reccurense;
	}

	public Integer getRepetition() {
		return repetition;
	}

	public void setRepetition(Integer repetition) {
		this.repetition = repetition;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}


	public EndType getEndType() {
		return endType;
	}

	public void setEndType(EndType endType) {
		this.endType = endType;
	}

	public List<DayOfWeekend> getDayOfWeekend() {
		return dayOfWeekend;
	}

	public void setDayOfWeekend(List<DayOfWeekend> dayOfWeekend) {
		this.dayOfWeekend = dayOfWeekend;
	}

}
